function isEqualObject(obj1, obj2) {
  let keys1 = Object.keys(obj1);
  let keys2 = Object.keys(obj2);
  if (keys1.length !== keys2.length) {
    return false;
  }
  for (let key of keys1) {
    if (obj1[key] !== obj2[key]) {
      return false;
    }
  }
  return true;
}

let obj1 = {
  name: 'zs',
  age: 20,
  hobby: [
    {
      id: 1,
      name: 'zs',
    },
    {
      id: 3,
      name: 'person',
    },
  ],
};
let obj2 = {
  name: 'zs',
  age: 20,
  hobby: [
    {
      id: 1,
      name: 'zs',
    },
    {
      id: 3,
      name: 'person',
    },
  ],
};
console.log(isEqualObject(obj1, obj2));
